import { request } from 'umi';
import type { ChargerItem } from './API.d';

class U {}

export async function queryChargerList(
  params: U & { pageSize?: number; current?: number; keyword?: string },
) {
  return request('/parkinglot/charger/queryChargerList', {
    method: 'POST',
    data: params,
  });
}

export async function addCharger(params: ChargerItem) {
  return request('/parkinglot/charger/addCharger', {
    method: 'POST',
    data: params,
  });
}

export async function removeCharger(params: number[]) {
  return request('/parkinglot/charger/removeCharger', {
    method: 'POST',
    data: params,
  });
}

export async function updateCharger(params: ChargerItem) {
  return request('/parkinglot/charger/updateCharger', {
    method: 'POST',
    data: params,
  });
}

export async function upCharger(params: number[]) {
  return request('/parkinglot/charger/upCharger', {
    method: 'POST',
    data: params,
  });
}

export async function downCharger(params: number[]) {
  return request('/parkinglot/charger/downCharger', {
    method: 'POST',
    data: params,
  });
}
